/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simhya.modelchecking;

/**
 *
 * @author Luca
 */
public class SMCtestData implements SMCcontroller, SMCoutput {
    long total = 0;
    long good = 0;
    
    double error;
    double confidence;
    
    int samplesNeeded;
    String formula;

    boolean value;
    TestMethod method;
    boolean stop = false;

    public SMCtestData() {
        this.method = TestMethod.WALD;
        error = 1e-4;
        confidence = 0.95;
    }

    public SMCtestData(TestMethod method) {
        this.method = method;
        error = 1e-4;
        confidence = 0.95;
    }

    public SMCtestData(double error, double confidence) {
        this.error = error;
        this.confidence = confidence;
        this.method = TestMethod.WALD;
    }

    public SMCtestData(double error, double confidence, TestMethod method) {
        this.error = error;
        this.confidence = confidence;
        this.method = method;
    }
    
    public void addPoint(boolean[] value) {
        total++;
        if (value[0]) good++;
    }
    
    private void checkStopCondition() {
        if (method == TestMethod.WALD)
            checkStopConditionWald();
        else if (method == TestMethod.BAYESIAN)
            checkStopConditionBayesian();
    }
    
    private void checkStopConditionWald() {
        
    }
    
    private void checkStopConditionBayesian() {
        
    }
    
    public boolean stop() {
        return stop;
    }
    
    public void finalize() {
        
    }
    
}
